import numpy as np
#test = np.zeros((m, n), dtype=np.int)


def ShowPn(n):
    if(n < 1):
        print('input invalid value!')
    else:
        # skip 0 
        maxl = n + 1
        cl = [False] * maxl
        si = 2
        result = ''
        # set odd = true, even = false
        for i in range(1, maxl):
            d = i % 2
            if(d == 1):
                cl[i] = True
            else:
                cl[i] = False
        
        # set 2 is ture manually
        if(n > 1):
            cl[si] = True
        # set the index which (some true index)*times to false
        for i in range(1, maxl):
            if(i > si):
                if(cl[i]):
                    for j in range(i + i, maxl, i):
                        cl[j] = False
                else:
                    continue
            else:
                continue
        # contact result 
        for i in range(1, maxl):
            if(cl[i]):
                result = result + ',' + str(i)
        
        print(result.lstrip(','))

ShowPn(10)



'''
def ShowPn(n):
    startindex = 3
    checklist = np.empty([1,n],dtype=bool)
    for i in range(n+1):
        t = i + 1
        d = t % 2
        if(d == 1):
            checklist[0][t] = True
        else:
            checklist[0][t] = True 


test = np.zeros([1,10], dtype=bool)
print(test[0][0])

for i in range(10):
    if(not test[0][i]):        
        print(str(i))
    else:
        print('a')
'''



